package com.jie.langlangmall.common.exception;

import com.jie.langlangmall.common.api.IErrorCode;
import lombok.Getter;

/**
 * @Author Jie
 * @Date 2024/11/21 14:40
 * @Email 3217998214@qq.com
 * @Description 自定义api异常
 */
@Getter
public class ApiException extends RuntimeException {
    private IErrorCode errorCode;

    public ApiException(IErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

}
